﻿using RS.ZhaoXiWidgets.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Threading;


namespace RS.ZhaoXi.Views.Home
{

    public partial class HomeView : ZXWindow
    {
        public HomeViewModel ViewModel { get; set; }
        public HomeView()
        {
            InitializeComponent();
            this.ViewModel = this.DataContext as HomeViewModel;
            this.Loaded += HomeView_Loaded;
        }

        public DispatcherTimer DispatcherTimer { get; set; }

        private void HomeView_Loaded(object sender, RoutedEventArgs e)
        {
            DispatcherTimer = new DispatcherTimer();
            DispatcherTimer.Tick += DispatcherTimer_Tick;
            DispatcherTimer.Interval = TimeSpan.FromSeconds(1);
            DispatcherTimer.Start();
        }

        private void InitializePlot()
        {
            
        }

        private void DispatcherTimer_Tick(object? sender, EventArgs e)
        {
            this.ViewModel.DateTimeNow = DateTime.Now;
        }

        private void Image_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            Process.Start("explorer", "https://wechat.zhaoxiedu.net/");
        }
    }
}
